#include <QtGui>
#include <QtCore/QTextCodec>
#include <QTranslator>
#include "gv_setuphomedialog.h"
#include "gv_setupchangepwddiaglog.h"
#include "gv_setuplanguagedialog.h"
#include "gv_setuptimedialog.h"
#include "gv_monitormodedialog.h"
#include "gv_monitorerrorlogdialog.h"
#include "gv_home.h"
#include "gv_setting.h"

extern GV_Setting *gvsetting;
extern QDialog  *dialog;
GV_MonitormodeErrorlogDialog::GV_MonitormodeErrorlogDialog(QWidget *parent)
       : QDialog(parent)
{
    setupUi(this);

    QTranslator translator;
    translator.load(gvsetting->GV_GetLanguage(),".");
    qApp->installTranslator(&translator);
    reloadtext();

    TimeHintsLabel->setText((QDateTime::currentDateTime().toString("hh:mm:ss")));
    DateHintsLabel->setText((QDateTime::currentDateTime().toString("yyyy-MM-dd")));
    timer = new QTimer;
    connect(timer,SIGNAL(timeout()),this,SLOT(GV_chTime()));
    connect(BackButton,SIGNAL(clicked()),this,SLOT(home()));
    connect(CancelButton,SIGNAL(clicked()),this,SLOT(home()));

    //connect(ChangePWDButton,SIGNAL(clicked()),this,SLOT(changepwd()));
    //connect(TimeanddateButton,SIGNAL(clicked()),this,SLOT(timeanddate()));
    //connect(LanguageselectionButton,SIGNAL(clicked()),this,SLOT(changelanguage()));
    timer->start(1000);
}
void GV_MonitormodeErrorlogDialog::reloadtext()
{
    //NameHintsLabel->setText(tr("Zones"));
}
void GV_MonitormodeErrorlogDialog::GV_chTime()
{
    TimeHintsLabel->setText((QDateTime::currentDateTime().toString("hh:mm:ss")));
    DateHintsLabel->setText((QDateTime::currentDateTime().toString("yyyy-MM-dd")));
}

void GV_MonitormodeErrorlogDialog::home()
{
    QDialog *dialog1 = new GV_MonitormodeHomeDialog;
    dialog1->show();
    delete dialog;
    dialog = dialog1;
}






